Add OSTREE_BUILT_FEATURES to ostree-version.h
authorColin Walters <walters@verbum.org>
Wed, 24 Jul 2019 21:31:54 +0000 (21:31 +0000)
committerAtomic Bot <atomic-devel@projectatomic.io>
Mon, 29 Jul 2019 13:58:13 +0000 (13:58 +0000)
This way projects can dispatch at run-time based on ostree's
build time options, e.g. detect the availability of GPG.

Closes: #1890
Approved by: jlebon

configure.ac
src/libostree/ostree-version.h.in

index 3f125638e341454ea3d4efcc4e464e4a86531c12..1d083d95b37c61890315eabc6090f9fcc153abfa 100644 (file)
@@ -584,6 +584,9 @@ OSTREE_FEATURES="$OSTREE_FEATURES $release_build_type"
 # P2P API is public in OSTree >= 2018.6
 OSTREE_FEATURES="$OSTREE_FEATURES p2p"
 
+# Strip leading whitespace
+OSTREE_FEATURES=$(echo ${OSTREE_FEATURES})
+
 AC_CONFIG_FILES([
 Makefile
 apidoc/Makefile
index 8edb9116c7b28379acec73f121d02987ef2f1595..2c7ecdecfaeb67a9603c95aecd6bc28ddb64a4bf 100644 (file)
 #define OSTREE_CHECK_VERSION(year,release)   \
         (OSTREE_YEAR_VERSION > (year) || \
          (OSTREE_YEAR_VERSION == (year) && OSTREE_RELEASE_VERSION >= (release)))
+
+/**
+ * OSTREE_BUILT_FEATURES:
+ *
+ * Whitespace separated set of features this libostree was configured with at build time.
+ * Consult the source code in configure.ac (or the CLI `ostree --version`) for examples.
+ *
+ * Since: 2019.3
+ */
+#define OSTREE_BUILT_FEATURES "@OSTREE_FEATURES@"